package com.aolong.archives.core.sysmanage.action;

import net.sf.json.JSONObject;

import com.aolong.archives.common.resource.I18nBundleUtil;
import com.aolong.archives.core.sysmanage.service.II18nResourceService;
import com.rock.platform.action.BaseAction;

public class I18nResourceAction extends BaseAction {

	private static final long serialVersionUID = 1L;

	private II18nResourceService service;
	
	public String findBySession()
	{
		this.setJsonString(I18nBundleUtil.getInstance().getJsonString(this.getLoginBean().getLanguage()));

		return SUCCESS;
	}
	
	public String add()
	{
		JSONObject jo = JSONObject.fromObject(this.getJsonString());

		this.service.add(jo, this.getLoginBean().getLanguage());
		
		return SUCCESS;
	}

	public II18nResourceService getService() {
		return service;
	}

	public void setService(II18nResourceService service) {
		this.service = service;
	}
}
